/**
新增、修改dialog框架
 */
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogVisible"
    :width="formConf.width"
    append-to-body
    center
    :title="formConf.title"
  >
    <el-form :inline="true" :model="data" class="demo-form-inline" :rules="formConf.rules">
      <el-form-item
        v-for="(item,index) in formConf.data"
        :key="index"
        :label="item.title"
        :prop="item.prop"
      >
        <template v-if="item.type === 'input'">
          <el-input v-model="data[item.prop]" :placeholder="item.title"></el-input>
        </template>
        <template v-if="item.type === 'select'">
          <el-select
            v-model="data[item.prop]"
            filterable
            :placeholder="item.title"
            :multiple="item.multiple"
            @change="selectChange(item.prop)"
          >
            <el-option
              v-for="each in item.data"
              :key="each.value"
              :label="each.label"
              :value="each.value"
            ></el-option>
          </el-select>
        </template>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: {
    //查询条件
    formConf: {
      type: Object,
    },
    data: {},
  },
  data() {
    return {
      dialogVisible: false,
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    show() {
      debugger;

      this.dialogVisible = true;
    },
  },
};
</script>
<style>
</style>